<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>日志管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function () {

        });

        function page(n, s) {
            $("#pageCurrent").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
    </script>
</head>
<body>
<ul class="nav nav-tabs">
    <li class="active"><a href="${ctx}/sysLog/log/">日志列表</a></li>
</ul>
<form:form id="searchForm" modelAttribute="sysLog" action="${ctx}/sys/sysLog/" method="post"
           class="breadcrumb form-search">
    <input id="pageCurrent" name="pageCurrent" type="hidden" value="${page.current}"/>
    <input id="pageSize" name="pageSize" type="hidden" value="${page.size}"/>
    <ul class="ul-form">
        <li><label>操作菜单：</label>
            <form:input path="title" htmlEscape="false" maxlength="50" class="input-medium"/>
        </li>
        <li>
            <label>用户12ID：</label>
            <form:input path="createBy" htmlEscape="false" maxlength="50" class="input-medium"/>
        </li>
        <li>
            <label>URI：</label>
            <form:input path="requestUri" htmlEscape="false" maxlength="50" class="input-medium"/>
        </li>
        <li>
            <label>日期范围：</label>
            <input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20"
                   class="input-mini Wdate"
                   value="<fmt:formatDate value="${log.beginDate}" pattern="yyyy-MM-dd"/>"
                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
            <input id="endDate" name="endDate" type="text"
                   readonly="readonly" maxlength="20"
                   class="input-mini Wdate"
                   value="<fmt:formatDate value="${log.endDate}" pattern="yyyy-MM-dd"/>"
                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
        </li>
        <li>
            <label for="exception">只看异常</label>
            <input id="exception" name="exception"
                   type="checkbox"${log.exception eq '1'?' checked':''}
                   value="1"/>

        </li>
        <li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
        <li class="clearfix"></li>
    </ul>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <thead>
    <tr>
        <th>操作菜单</th>
        <th>操作用户</th>
        <th>所在机构</th>
        <th>URI</th>
        <th>提交方式</th>
        <th>操作者IP</th>
        <th>操作时间</th>
        <th>异常信息</th>
    </thead>
    <tbody><%
        request.setAttribute("strEnter", "\n");
        request.setAttribute("strTab", "\t");
    %>
    <c:forEach items="${page.records}" var="log">
        <tr>
            <td>${log.title}</td>
            <td>${fns:getUserNameById(log.createBy)}</td>
            <td>${fns:getUserOfficeName(log.createBy)}</td>
            <td><strong>${log.requestUri}</strong></td>
            <td>${log.method}</td>
            <td>${log.remoteAddr}</td>
            <td><fmt:formatDate value="${log.createDate}" type="both"/></td>
            <td><c:if test="${not empty log.exception}">点击查看</c:if></td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>
